import { _decorator, Component, Node } from 'cc';
import HIT from './HitCtrl';
const { ccclass, property } = _decorator;

@ccclass('NodeCtrl')
export class NodeCtrl extends Component {
     ctrlNode: Node = null;
     protected onDisable(): void {
        this.ctrlNode = null;
         
     }

    deleteNode() {
        if (this.ctrlNode) {
            HIT.clearNodeCtrl(this.ctrlNode);
            this.ctrlNode = null;
        }
    }
    rotateNode() {
        if (this.ctrlNode) {
            const y = this.ctrlNode.eulerAngles.y;
            this.ctrlNode.setRotationFromEuler(0, y - 90, 0);
        }
    }
}

